﻿/*
 * Imigrasi SMS (Special built for Immigration Office)
 * Copyright (C) 2010 Wish Enterprise Development Team

 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 * Contact Us:
 * E-Mail   : contact@wishenterprise.com     Website: http://www.wishenterprise.com
 * 
 * */

using System.Collections.Generic;
using Origami.Data;
using Origami.Data.Query;

namespace SmsRepository
{
    /// <summary>
    /// IDataAccess
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IDataAccess<T>
    {
        /// <summary>
        /// Gets the by id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        T GetById(string id);

        /// <summary>
        /// Gets all.
        /// </summary>
        /// <returns></returns>
        List<T> GetAll();

        /// <summary>
        /// Creates the query.
        /// </summary>
        /// <returns></returns>
        ObjectQuery CreateQuery();

        /// <summary>
        /// Gets the meta data.
        /// </summary>
        /// <returns></returns>
        List<MetaData> GetMetaData();

        /// <summary>
        /// Saves the specified obj.
        /// </summary>
        /// <param name="obj">The obj.</param>
        /// <returns></returns>
        int Save(T obj);

        /// <summary>
        /// Updates the specified obj.
        /// </summary>
        /// <param name="obj">The obj.</param>
        /// <returns></returns>
        int Update(T obj);

        /// <summary>
        /// Deletes the specified obj.
        /// </summary>
        /// <param name="obj">The obj.</param>
        /// <returns></returns>
        int Delete(T obj);
    }
}